﻿using IdentityServer4.Models;
using IdentityServer4.Test;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Ids4Review.IdentityCenter
{
    public class Config
    {
        public static IEnumerable<ApiResource> GetApiResources()
        {
            return new List<ApiResource>()
            {
                 new ApiResource("test_api","test_api")
            };
        }

        public static IEnumerable<Client> GetClients()
        {
            return new List<Client>()
            {
                 new Client(){
                      AllowedGrantTypes={ GrantType.ResourceOwnerPassword,GrantType.ClientCredentials},
                      ClientId="test_api",
                      AllowedScopes={ "test_api"},
                      ClientSecrets={ new Secret("p@ssw0rd".Sha256())}
                 }
            };
        }

        public static IEnumerable<TestUser> GetUsers()
        {
            return new List<TestUser>()
            {
                new TestUser(){ SubjectId="1", Username="admin",Password="p@ssw0rd" }
            };
        }
    }
}
